<?php

namespace App\Exceptions;

use App\Tools\DdPush;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;

class Handler extends ExceptionHandler
{
    /**
     * A list of the exception types that are not reported.
     *
     * @var array
     */
    protected $dontReport = [
        //
    ];

    /**
     * A list of the inputs that are never flashed for validation exceptions.
     *
     * @var array
     */
    protected $dontFlash = [
        'password',
        'password_confirmation',
    ];

    /**
     * Register the exception handling callbacks for the application.
     *
     * @return void
     */
    public function register()
    {
        $this->reportable(function (Throwable $e) {
            //
        });
    }
//    /**
//     * Render an exception into an HTTP response.
//     *
//     * @param \Illuminate\Http\Request $request
//     * @param \Exception $exception
//     * @return \Illuminate\Http\Response
//     */
//    public function render($request, Exception $exception)
//    {
//
//        if ($exception instanceof \Symfony\Component\Debug\Exception\FatalErrorException) {
//
//            $message['错误信息'] = $exception->getMessage();
//            $message['文件地址'] = $exception->getFile();
//            $message['在第几行'] = $exception->getLine();
//            $message['传递方式'] = $request->isMethod('POST') ? 'POST' : 'GET';
//            $message['传递参数'] = $request->input();
//            $message['网络地址'] = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
//            $message['来源IP']  = $_SERVER["REMOTE_ADDR"];
//            $message['设备信息'] =  $_SERVER["HTTP_USER_AGENT"];
//
//        }
//        return parent::render($request, $exception);
//    }
}
